<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>查勘员添加</title>
  <t:base type="jquery,easyui,tools"></t:base>
   <script type="text/javascript">
  $(function(){
	  $("#area").val("${tmblAppUserPage.area}");
  });/* 下拉框有默认值 */
  
  
  function openDepartmentSelect() {
		$.dialog.setting.zIndex = getzIndex(true); 
		
		var orgIds = $("#orgIds").val();
		
		$.dialog({content: 'url:departController.do?departSelect&orgIds='+orgIds, zIndex: 2100, title: '组织机构列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
		   {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
		   {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
	   ]}).zindex();
	}
		
	function callbackDepartmentSelect() {
		  var iframe = this.iframe.contentWindow;
		  var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
		  var nodes = treeObj.getCheckedNodes(true);
			  var ids='',names='',code='';
			  if(nodes.length>1){
				  alert("只能选择一个机构");
			  }else{
			 
				  for(i=0;i<nodes.length;i++){
				     var node = nodes[i];
				     code= node.orgCode;
				     names= node.name;
				     ids += node.id+',';
				     
				 }
				 $('#dptName').val(names);
				 $('#dptName').blur();		
				 $('#dptCde').val(code);
				 $('#orgIds').val(ids);
				
			}
	}
	
	function callbackClean(){
		$('#dptName').val('');
		$('#dptCde').val('');	
		$('#orgIds').val('');	
	}
	
	function setOrgIds() {}
  </script>
  <script type="text/javascript">/* 服务点添加 */
  function openWorkSelect() {
	  
		$.dialog.setting.zIndex = getzIndex(true); 
		
		var wpId = $("#wpId").val(); 
		
		$.dialog({content: 'url:tmblAppUserController.do?workPlaceSelect&wpId='+wpId, zIndex: 2100, title: '服务点列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
		   {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackWorkSelect, focus: true},
		   {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
	   ]}).zindex();
	}
		
	function callbackWorkSelect() {
		
		  var iframe = this.iframe.contentWindow;
		  var treeObj = iframe.$.fn.zTree.getZTreeObj("placeSelect");
		  var nodes = treeObj.getCheckedNodes(true);
		  var id='',name='',address='',phone='';
		  if(nodes.length>1){
			  alert("只能选择一个服务点");
		  }else{
		 
			  for(i=0;i<nodes.length;i++){
			     var node = nodes[i];
			     id= node.id;
			     name= node.name;
			     address=node.address;
			     phone=node.phone;
			 }
			 
			 $('#workplaceName').val(name);
			 $('#workplaceName').blur();		
			 $('#workplaceId').val(id);
			 $('#phone').html(phone);
			 $('#address').html(address);
			 $("#wpId").val(id);
		}
	}
	
	function callworkbackClean(){
		$('#workplaceId').val('');
		$('#workplaceName').val('');
		 $('#phone').html('');
		 $('#address').html('');
		 $("#wpId").val('');
	}
	
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="tmblAppUserController.do?doAdd" >
					<input id="id" name="id" type="hidden" value="${tmblAppUserPage.id }">
		<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							查勘员工号:
						</label>
					</td>
					<td class="value">
					     	 <input id="empCde" name="empCde" type="text" style="width: 150px" class="inputxt" validType="tmbl_app_user,T_EMP_CDE,id" datatype="s2-10" />
							<span class="Validform_checktip"><t:mutiLang langKey="请填写业务员工号"/></span>
							<label class="Validform_label" style="display: none;">业务员工号</label>
						</td>
				</tr>
				<tr>
				
					<td align="right">
						<label class="Validform_label">
							查勘员登陆密码:
						</label>
					</td>
					<td class="value">
					     	 <input id="empPassWord" name="empPassWord" type="password" style="width: 150px" class="inputxt" 
					     	 plugin="passWordStrength" datatype="*6-18" style="display: none;">
							<%-- <span class="Validform_checktip"  style="display: none;">
								<span><t:mutiLang langKey="common.weak"/></span>
                        		<span><t:mutiLang langKey="common.middle"/></span>
								<span class="last"><t:mutiLang langKey="common.strong"/></span>
							</span> --%>
							<label class="Validform_checktip"><t:mutiLang langKey="password.rang6to18"/></label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label"> <t:mutiLang langKey="common.repeat.password"/>: </label>
					</td>
					<td class="value">
                    	<input id="repassword" class="inputxt" type="password" value="" recheck="empPassWord" datatype="*6-18" errormsg="两次输入的密码不一致！">
                    	<span class="Validform_checktip"><t:mutiLang langKey="common.repeat.password"/></span>
               	 	</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							查勘员姓名:
						</label>
					</td>
					<td class="value">
					     	 <input id="empName" name="empName" type="text" style="width: 150px" class="inputxt" datatype="*2-10">
							<span class="Validform_checktip"><t:mutiLang langKey="fill.realname"/></span>
							
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							所属机构:
						</label>
					</td>
					<td class="value">
					     	 <input id="dptName" name="dptName" type="text" style="width: 150px" class="inputxt" datatype="*" errormsg="请选择所属机构!" readonly="readonly">
					     	 <input id="dptCde" name="dptCde" type="hidden" >
					     	 <input id="orgIds" name="orgIds" type="hidden" value="${orgIds}">
					     	 <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="departSearch" onclick="openDepartmentSelect()">选择</a>
                			 <a href="#" class="easyui-linkbutton" plain="true" icon="icon-redo" id="departRedo" onclick="callbackClean()">清空</a>
							<span class="Validform_checktip"><t:mutiLang langKey="请选择所属机构"/></span>
							
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							邮箱:
						</label>
					</td>
					<td class="value">
					     	 <input id="email" name="email" type="text" style="width: 150px" class="inputxt"  datatype="e" errormsg="邮箱格式不正确!" ignore="ignore">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">邮箱</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							手机号:
						</label>
					</td>
					<td class="value">
					     	 <input id="phoneNo" name="phoneNo" type="text" style="width: 150px" class="inputxt" datatype="n" errormsg="办公室电话不正确" ignore="ignore">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">手机号</label>
						</td>
				</tr>
				
				
				<tr>
					<td align="right">
						<label class="Validform_label">
							服务点:
						</label>
					</td>
					<td class="value">
							 <input id="workplaceId" name="workPlace.id" type="hidden" style="width: 150px" class="inputxt" >
					     	 <input id="workplaceName" name="workPlace.workplace" type="text" readonly="readonly" style="width: 150px" class="inputxt"  >
					     	 <input id="wpId" name="wpId" type="hidden"   value="${wpId}" >
					     	 <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="departSearch" onclick="openWorkSelect()">选择</a>
                			 <a href="#" class="easyui-linkbutton" plain="true" icon="icon-redo" id="departRedo" onclick="callworkbackClean()">清空</a>
					     	 <span class="Validform_checktip"></span>
							
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							服务点地址:
						</label>
					</td>
					<td  class="value" style="height: 15px">
					
					     <label id="address"   > </label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							服务点电话:
						</label>
					</td>
					<td class="value"  style="height: 15px">
						<label id="phone"   > </label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							区域:
						</label>
					</td>
					<td class="value">
					
					<t:dictSelect id="area" hasLabel="false" field="area" typeGroupCode="workArea" ></t:dictSelect>
					     	<!--  <select name="area" >
					     	 	<option value="1">城镇</option>
					     	 	<option value="2">高速公路</option>
					     	 </select> -->
						</td>
				</tr> 
				<tr>
					<td align="right">
						<label class="Validform_label">
							类别:
						</label>
					</td>
					
					<td class="value"  style="height: 15px">
						 <select name="statue" id="statue">
					     	 	<option value="1">普通用户</option>
					     	 	<option value="2">审核员</option>
					     </select>
					</td>
						
				</tr> 
				<tr>
					<td align="right">
						<label class="Validform_label">
							职位状况:
						</label>
					</td>
					
					<td class="value"  style="height: 15px">
						 <select name="isWork" id="isWork">
					     	 	<option value="1">在职</option>
					     	 	<option value="0">离职</option>
					     </select>
					</td>
						
				</tr> 
			</table>
		</t:formvalid>
 </body>
 
